<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2018/10/6
 * Time: 14:02
 */
include "config.php";
$sql="SELECT *FROM cart WHERE u_id='".$_REQUEST["uid"]."'";
$res=$link->query($sql);
$link->close();
$resarr=array();
while ($r=$res->fetch_assoc()){
    array_push($resarr,$r);
}
print_r(json_encode($resarr));